import { ErrorHandler, Injectable } from '@angular/core';
import {MessageService} from './message.service';
import {appInjector} from '../../shared/utils/app-injector';

@Injectable()
export class AppGlobalErrorHandler implements ErrorHandler {


  messageService = appInjector().get(MessageService);

  handleError(error) {
    this.messageService.notifyError(error);
    console.warn('customize catch execption:' + error);
  }
}
